
// import { NormalCard,Card } from "../pock/types";
import { CradColor, mark } from "./enums";
import { Card, Deck , Joker, NormalCard} from "./types";
function createDock():Deck{
    const deck:Deck = []; // 定义扑克
    const marks = Object.values(mark)
    const colors = Object.values(CradColor)
    for (const m of marks) {
        const element = m;
        for(const c of colors){
            const card:NormalCard={
                color:c,
                mark:m,
                getString(){
                   return this.color+this.mark
                }
                
            }
            deck.push(card)
        }
        
    }
    let Joker:Joker = {
        type:"big",
        getString(){
            return "Joker"
        }
    }
    let joker:Joker = {
        type:"small",
        getString(){
            return "joker"
        }
    }
    deck.push(Joker)
    deck.push(joker)
    return deck
}
function printDeck(deck:Deck){
    let result="\n";
    deck.forEach((item,index)=>{
       let  str= item.getString();
        result +=str+"\t"
       if((index+1)%6 ===0){
        result += "\n"
       }
    })
  
    
    console.log(result)
}
const deck = createDock()
printDeck(deck)